import request from '@/config/axios'
import type { TableData } from './types'

export const getTableListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/example/list', params })
}

//OrderList
export const OrderList = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/addOrdersGoods', params })
}

export const Exhibition = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/getOrderDetails', params })
}

//CurriculumList
export const CurriculumList = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/selCourseOrderListData', params })
}

export const Exhibition2 = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/selCourseOrderLists', params })
}

//ReturnList
export const ReturnList = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/returnGoods', params })
}

export const Exhibition3 = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/SyOperationController/getOrderDetails', params })
}

//DmList
export const DmList = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/personnel/selDeptList', params })
}

export const updDeptInfo = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/personnel/updDeptInfo', params })
}

export const del = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/personnel/delDeptInfo', params })
}

export const updDeptStatus = (params: any): Promise<IResponse> => {
  return request.post({ url: '/api/personnel/updDeptStatus', params })
}

// BmpList
export const selDeptName = (params: any): Promise<IResponse> => {
  return request.get({ url: 'http://localhost:8081/personnel/selDeptName', params })
}

export const selBackUserList = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/selBackUserList', params })
}

export const updBackUserEnabled = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/updBackUserEnabled', params })
}

export const selJurisdiction = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/selJurisdiction', params })
}


export const saveTableApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/example/save', data })
}

export const getTableDetApi = (id: string): Promise<IResponse<TableData>> => {
  return request.get({ url: '/example/detail', params: { id } })
}

export const delTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/example/delete', data: { ids } })
}

export const fenghaoone = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/addClosureLog', params})
}

export const fenghaotwo = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/addClosure', params})
}

export const fenghaothree = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/updBackUserStatus', params})
}

export const addRoleData = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/addRoleData', params })
}

export const getDeptid = (params: any): Promise<IResponse> => {
  return request.get({ url: 'http://localhost:8081/personnel/selDeptName', params })
}

export const getAddchenggong = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/getAddchenggong', params })
}

export const updBackUserInfo = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/updBackUserInfo', params })
}

export const SelVerion = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/SelVerion', params })
}

export const lzrAddVersion = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/lzrAddVersion', params })
}

